# UI_test/run.py
import os
import sys
import subprocess
from pathlib import Path

import pytest
from airtest.core.helper import log

dirname = os.path.abspath(os.path.dirname(__file__))  # 返回根目录
dirname1 = dirname.replace('\\', '/').replace('case', '')
sys.path.append(dirname1)
test_path = dirname1 + "/UI_test/case/test_login.py"

# ---------------------------
# 测试执行器
# ---------------------------
def run_tests():
    pytest.main(['-s', '-v', f'-n=1', '--alluredir=allure-results', test_path])


if __name__ == '__main__':
    log('run_tests')
    run_tests()
